var SceneUtil = function(options) {
	this.ctx = options.ctx;
	this.editor = options.editor;
	this.globe = options.editor.globe;
	this.dIndex;
}

SceneUtil.prototype.package= function(obj) {
	var _this = this;
	let option={};
	option.id= obj.id;
	option.parentId= obj.layerId;
	option.name= obj.name||'';
	option.code= obj.code||'';
	option.type= obj.type||'';
	option.position={
		x:obj.x*1,
		y:obj.y*1,
		z:obj.z*1
	}
	option.orientation={
		heading: obj.roll||0,
		pitch: obj.pitch||0,
		roll: obj.roll||0
	}
	option.propertys=obj.propertys;
	if('rectangular'==obj.type){
		option.baseUrl= _this.ctx||'';
		option.sensor={
			type:obj.type||'',
			scale:obj.scale||1,
			show:(obj.showRectangular==='1')?true:false,
			radius:obj.radius*1 ||50,
			angleX:obj.angleX||45,
			angleY:obj.angleY||45,
			color:obj.color||null,
			lineColor:obj.lineColor||null,
			showScanPlane:obj.showScanPlane||1,
			scanPlaneColor:obj.scanPlaneColor||null,
			scanPlaneRate:obj.scanPlaneRate||3,
			
		}
		option.attribute={
			parentId:obj.layerId,
			id:obj.id,		
			code:obj.code,
			eirp:obj.eirp,
			gr:obj.gr,
			pmin:obj.pmin,
			l:obj.l,
			mhz:obj.mhz,
			sort:obj.sort,
		}
	}
	else if('GLB'==obj.type || 'GLTF'==obj.type){
		option.antennas=obj.antennas;
		console.log(obj);
		option.model={
			url:_this.ctx +obj.url,
			type:'2',
			scale:obj.scale*1 ||1,
			show:obj.show*1 ||1,
			minimumPixelSize:obj.minimumPixelSize*1 ||0,
			allowPicking:obj.allowPicking*1 ||1,
			shadows:obj.shadows*1 ||1,
			distanceDisplayCondition:obj.distanceDisplayCondition||'0',
			distanceNear:obj.distanceNear ||0,
			distanceFar:obj.distanceFar ||5000,
			silhouette:obj.silhouette ||'0',
			silhouetteColor:obj.silhouetteColor ||null,
			silhouetteSize:obj.silhouetteSize ||1,
			fill:obj.fill ||'0',
			fillColor:obj.fillColor ||null,
		}
		option.attribute={
			code:obj.code,
			sort:obj.sort,
		}
	}
	else if('tileset'==obj.type){
		option={
    		id:	_this.globe.getUuid(),
    		name:obj.name,
    		code:obj.code||"",
    		type:'1',
			thing:{
				show:true,
				url:(obj.isRelative=='0') ?obj.url:_this.ctx+obj.url,
			}
    	}
	}
	return option;
}

